package com.zhbr.mvp.presenter;


import android.util.Log;

import com.zhbr.common.rx.BaseSubscriber;
import com.zhbr.entity.MPageInfo;
import com.zhbr.entity.TGdfwPqgd;
import com.zhbr.mvp.contract.HomeContract;
import com.zhbr.mvp.base.presenter.BasePresenter;
import com.zhbr.mvp.model.HomeModel;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class HomePresenter extends BasePresenter<HomeContract.View, HomeContract.Model> implements HomeContract.Presenter{


    @Override
    protected HomeContract.Model createModule() {
        return new HomeModel();
    }


    @Override
    public void getPqgd(int pageNum, int pageSize) {
        mModel.getPqgdAll(pageNum,pageSize, new BaseSubscriber<MPageInfo<TGdfwPqgd>>() {
            @Override
            public void onSuccess(MPageInfo data) {
                getView().getPqgdSuccess(data);
            }

            @Override
            public void onFailed(Throwable ex, String code, String msg) {
                HomePresenter.this.onFail(ex, code, msg);
            }

            @Override
            public void onError() {
                onNetError();
            }
        });
    }
}
